//package com.example.myapplication.FlutterDemo;
//
//import androidx.appcompat.app.AppCompatActivity;
//
//import android.content.Intent;
//import android.os.Bundle;
//import android.view.ViewGroup;
//import android.widget.FrameLayout;
//
//import com.example.myapplication.R;
//
//import io.flutter.embedding.android.FlutterView;
//import io.flutter.plugin.common.BasicMessageChannel;
//import io.flutter.plugin.common.EventChannel;
//import io.flutter.plugin.common.MethodChannel;
//
//public class FlutterAppActivity extends AppCompatActivity {
//
//    public final static String INIT_PRAMS = "initParams";
//    private UIPresenter uiPresenter;
//    private BasicMessageChannelPlugin basicMessageChannelPlugin;
//    private EventChannelPlugin eventChannelPlugin;
//
//    public static void start(FlutterDemoActivity context, String initParams){
//        Intent intent = new Intent(context,FlutterAppActivity.class);
//        intent.putExtra(INIT_PRAMS,initParams);
//        context.startActivity(intent);
//    }
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        String initParams = getIntent().getStringExtra(INIT_PRAMS);
//        FlutterView flutterView = Flutter.createView(this,getLifecycle(),initParams);
//        FrameLayout.LayoutParams layout =
//                new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup);
//        setContentView(flutterView,layout);
//        eventChannelPlugin = EventChannelPlugin.registerWith(flutterView);
//        //注册Flutter plugin
//        MethodChannelPlugin.registerWith(flutterView);
//        basicMessageChannelPlugin = BasicMessageChannelPlugin.registerWith(flutterView);
//        uiPresenter = new UIPresenter(this,"通讯与混合开发",);
//        setContentView(R.layout.activity_flutter_app);
//    }
//
//    @Override
//    public void onShowMessage(String message) {uiPresenter.showDartMessage(message);}
//
//    @Override
//    public void onSendMessage(String message,boolean useEventChannel) {
//        uiPresenter.showDartMessage(message);
//    }
//}